<template>
  <mavon-editor v-model="currentValue" :tabSize="2" placeholder="暂不支持上传图片" class="mavon-editor-desc" @change="onChange"/>
</template>

<script>
export default {
  props: {
    value: {
      type: String,
      default: ''
    },
    // 不使用calc属性，只支持px单位
    // 暂未实现自定义效果
    maxHeight: {
      type: Number,
      default: 500
    }
  },
  computed: {
    currentValue: {
      get () {
        return this.value
      },
      set (val) {
        this.$emit('change', val)
      }
    }
  },
  methods: {
    onChange (val) {
      this.$emit('change', val);
    }
  }
}
</script>

<style lang="scss" scoped>
.mavon-editor-desc {
  height: 500px;

  ::v-deep .v-note-panel {
    height: 460px;
    min-height: 460px;
    max-height: 460px;
  }
}
</style>
